package com.webtest.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import jdk.nashorn.internal.ir.annotations.Ignore;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
public class Shelf implements Serializable {
    @TableId(type = IdType.AUTO)
    @JsonSerialize(using= ToStringSerializer.class)
    private Long shelfId;
    private String shelfName;
    private String lng;
    private String lat;
    private Integer shelfMaxNum;
    private Integer shelfNum;
    private Integer shelfStatus;
    private Double shelfRate;
    @TableField(exist = false)
    private List<Book> books;
    @TableField(exist = false)
    private String newUrl;
    @TableField(exist = false)
    private String num;

    public String getLng() {
        return lng;
    }

    public void setLng(String lng) {
        this.lng = lng;
    }

    public String getLat() {
        return lat;
    }

    public void setLat(String lat) {
        this.lat = lat;
    }

    public void setNewUrl(String newUrl) {
        this.newUrl = newUrl;
    }

    public String getNum() {
        return num;
    }

    public void setNum(String num) {
        this.num = num;
    }

    public String getNewUrl() {
        return "http://localhost:8080/newBook?shelfId=" + shelfId;
    }
    public List<Book> getBooks() {
        return books;
    }

    public void setBooks(List<Book> books) {
        this.books = books;
    }

    public Long getShelfId() {
        return shelfId;
    }

    public void setShelfId(Long shelfId) {
        this.shelfId = shelfId;
    }

    public String getShelfName() {
        return shelfName;
    }

    public void setShelfName(String shelfName) {
        this.shelfName = shelfName;
    }

    public Integer getShelfMaxNum() {
        return shelfMaxNum;
    }

    public void setShelfMaxNum(Integer shelfMaxNum) {
        this.shelfMaxNum = shelfMaxNum;
    }

    public Integer getShelfNum() {
        return shelfNum;
    }

    public void setShelfNum(Integer shelfNum) {
        this.shelfNum = shelfNum;
    }

    public Integer getShelfStatus() {
        return shelfStatus;
    }

    public void setShelfStatus(Integer shelfStatus) {
        this.shelfStatus = shelfStatus;
    }

    public Double getShelfRate() {
        return shelfRate;
    }

    public void setShelfRate(Double shelfRate) {
        this.shelfRate = shelfRate;
    }
}
